import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by root on 4/22/14.
 */
public class Factors {
    public static void main(String[] args) {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            System.out.print("Enter a number:");
            int number = Integer.parseInt(br.readLine());
            List<Integer> factors = new ArrayList<Integer>();
            factors = printFactors(number);
            System.out.println(factors);
        } catch (IOException e) {
            System.out.print("Error Message:" + e.getStackTrace());
        }
    }

    public static List<Integer> printFactors(int number) {
        int i;
        List<Integer> factors = new ArrayList<Integer>();
        for(i=2;i<number;i++)
        {
            if (number%i==0) {
                factors.add(i);

            }
        }
        return factors;
    }
}